package com.example.aircraftwar.codes.prop;

import android.content.Context;

import com.example.aircraftwar.codes.aircraft.Observer;

import java.util.ArrayList;
import java.util.List;

public class BombProp extends AbstractProp {
    private List<Observer> observerList;

    public BombProp(Context context, int locationX, int locationY, int speedX, int speedY) {
        super(context, locationX, locationY, speedX, speedY);
        observerList = new ArrayList<>();
    }

    public void addObserver(Observer observer){
        observerList.add(observer);
    }

    private void notifyAllObserver(){
        for(Observer observer : observerList){
            observer.react();
        }
    }

    @Override
    public void propAct(){
        notifyAllObserver();
    }
}
